#pragma once

namespace DYMath
{
	struct Vector4;

	struct Vector3
	{
		float x;
		float y;
		float z;

		Vector3() : x(0), y(0), z(0) { }
		Vector3(const Vector3& v) = default;
		Vector3(float a, float b, float c): x(a), y(b), z(c) { }

		Vector3 operator-()
		{
			return Vector3(-x, -y, -z);
		}

		Vector3& operator=(const Vector4& v)
		{
			x = v.x;
			y = v.y;
			z = v.z;
			return *this;
		}
	};

	inline Vector3 operator+(float scaler, const Vector3& v)
	{
		return Vector3(scaler + v.x, scaler + v.y, scaler + v.z);
	}

	inline Vector3 operator+(const Vector3& v, float scaler)
	{
		return Vector3(v.x + scaler, v.y + scaler, v.z + scaler);
	}

	inline Vector3 operator+(const Vector3& v1, const Vector3& v2)
	{
		return Vector3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
	}

	inline Vector3 operator-(float scaler, const Vector3& v)
	{
		return Vector3(scaler - v.x, scaler - v.y, scaler - v.z);
	}

	inline Vector3 operator-(const Vector3& v, float scaler);

	inline Vector3 operator-(const Vector3& v1, const Vector3& v2);

	inline Vector3 operator*(float scaler, const Vector3& v);

	inline Vector3 operator*(const Vector3& v, float scaler);

	inline Vector3 operator*(const Vector3& v1, const Vector3& v2);

	inline Vector3 operator/(float scaler, const Vector3& v);

	inline Vector3 operator/(const Vector3& v, float scaler);

	inline Vector3 operator/(const Vector3& v1, const Vector3& v2);
}